import http from '@/utils/http'

// 获取房间类型列表
export const getRoomTypeList = () => {
  return http.get('/room/type/list.do')
}

// 创建房间类型
export const createRoomType = (data: any) => {
  return http.post('/room/type/create.do', data)
}

// 更新房间类型
export const updateRoomType = (data: any) => {
  return http.post('/room/type/update.do', data)
}

// 删除房间类型
export const deleteRoomType = (id: number) => {
  return http.delete(`/room/type/delete/${id}.do`)
}

// 获取房间列表
export const getRoomList = (params: { pageNum: number; pageSize: number }) => {
  return http.get('/room/list.do', { params })
}

// 根据状态获取房间
export const getRoomsByStatus = (status: string) => {
  return http.get('/room/listByStatus.do', { params: { status } })
}

// 创建房间
export const createRoom = (data: any) => {
  return http.post('/room/create.do', data)
}

// 更新房间
export const updateRoom = (data: any) => {
  return http.post('/room/update.do', data)
}

// 删除房间
export const deleteRoom = (id: number) => {
  return http.delete(`/room/delete/${id}.do`)
}